const Controller = require('../controllers/Controller.js').controller;
const app = getApp();
Page({
  data: {
    globalStype:'',
    listByTypedata:'',
    id:"",
    title:""
  },
  onLoad(options){
    this.setData({globalStype:app.globalData.globalStype})
    this.setData({
      id:options.id
    })
    if(this.data.id==6){
      this.setData({
        title:"用户协议"
      })
    }else if(this.data.id==18){
      this.setData({
        title:"隐私协议"
      })
    }
    this.listByType()
  },
  listByType() {
    Controller.listByType({
      id: this.data.id
    }).then(result => {
      
      var jsonDa = JSON.stringify(result.data).replace(/<img/gi, "<img class='richImg'style='width:auto!important;height:auto!important;max-height:100%;width:100%;'");
      var newResData = JSON.parse(jsonDa);
      this.setData({
        listByTypedata:newResData
      })
    });
  },
})